import { createRouter, createWebHashHistory } from 'vue-router';
import { RouterNamed } from './Named';

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    /**
     * 用户管理
     */
    {
      path: `/user`,
      name: RouterNamed.USER_MANAGER,
      component: () => import('@/views/user-manager/index.vue'),
    },
    /**
     * 角色管理
     */
    {
      path: `/role`,
      name: RouterNamed.ROLE_MANAGER,
      component: () => import('@/views/role-management/index.vue'),
    },
    /**
     * 角色授权
     */
    {
      path: `/authorize`,
      name: RouterNamed.ROLE_AUTHORIZATION,
      component: () => import('@/views/role-authorization/index.vue'),
    },
    /**
     * 组织机构
     */
    {
      path: `/org`,
      name: RouterNamed.ORGANIZATION,
      component: () => import('@/views/organization/index.vue'),
    },
  ],
});

export default router;
